<template>
  <div ref="charts" style="width:270px;height:60px"></div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  name: 'progressCharts',
  mounted () {
    let progressCharts = echarts.init(this.$refs.charts)
    progressCharts.setOption({
      grid: {
        top: 0,
        left: 0,
        right: 0,
        bottom: 0
      },
      xAxis: {
        show: false,
        min: 0,
        max: 100
      },
      yAxis: {
        show: false,
        type: 'category',
        // 柱状图宽度
      },
      series: [
        {
          type: 'bar',
          data: [78],
          // 柱状图宽度
          barWidth: 15,
          color: 'yellowgreen',
          // 展示背景颜色
          showBackground: true,
          // 展示文本
          label: {
            show: true,
            formatter: '|',
            position: 'right',
            color: 'yellowgreen'
          }
        }
      ]
    })
  }
}

</script>

<style>
</style>
